from django.urls import path, re_path
from . import views

app_name = 'teacher'

# 子路由配置
urlpatterns = [
    path('home/', views.index, name='index'),
    # path('index/', views.index),
    # 如果index换成home，怎么办，则重定名
    path('login/', views.login),
    path('index/', views.index),
    # 访问http://192.168.10.123:8000/teacher/detail/15/
    # path('detail/<int:pk>/', views.detail),   # <>可以捕获参数,int:是路径转换
    path('detail/<int:pk>/', views.detail, kwargs={'status': True}),   # <>可以捕获参数,int:是路径转换
    # path('students/<int:year>/<int:month>/', views.students),   #
    re_path(r'students/(?P<year>\d{4})/(?P<month>[0-9]|1[0-2])/', views.students),   #
]
